function log(target, propertyKey, descriptor) {
  const originalMethod = descriptor.value
  descriptor.value = function (...args) {
    console.log(`---> Calling ${propertyKey} with arguments: ${JSON.stringify(args)}`)
    const result = originalMethod.apply(this, args)
    console.log(`---> Finished ${propertyKey} with result: ${JSON.stringify(result)}`)
    return result
  }
  return descriptor
}

module.exports = log